﻿/*****************************************************************//**
 * @file    FITKAcousticsVTKGraphObjectSEABeam.h
 * @brief   Graph object for SEA sub-system beam data.
 *  
 * @author  ChengHaotian (yeguangbaozi@foxmail.com)
 * @date    2024-11-04
 *********************************************************************/

#ifndef __FITKACOUSTICSVTKGRAPHOBJECTSEABEAM_H__
#define __FITKACOUSTICSVTKGRAPHOBJECTSEABEAM_H__

#include "FITKAcousticsVTKGraphObjectSEASubSystem.h"

#include "FITKAcousticsVTKGraphAdaptorAPI.h"

// Forward declaration
class vtkUnstructuredGrid;
class vtkPoints;

class FITKAcousticsVTKGraphActor;

namespace Acoustics
{
    class FITKSEASubSysBeam;
}

namespace Exchange
{
    /**
     * @brief   Graph object for 'SEA sub-system beam'.
     * @author  ChengHaotian (yeguangbaozi@foxmail.com)
     * @date    2024-11-04
     */
    class FITKACOUSTICSGRAPHADAPTORAPI FITKAcousticsVTKGraphObjectSEABeam : public FITKAcousticsVTKGraphObjectSEASubSystem
    {
        // Regist
        FITKGraphObjectRegist(FITKAcousticsVTKGraphObjectSEABeam, FITKAcousticsVTKGraphObjectSEASubSystem);
        FITKCLASS(Exchange, FITKAcousticsVTKGraphObjectSEABeam);

    public:
        /**
         * @brief   Constructor.
         * @param   beam: The sub-system beam data
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-04
         */
        FITKAcousticsVTKGraphObjectSEABeam(Acoustics::FITKSEASubSysBeam* beam);

        /**
         * @brief   Destructor.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-04
         */
        ~FITKAcousticsVTKGraphObjectSEABeam() = default;

        /**
         * @brief   Update the visibility with data object's visibility.[override]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-12
         */
        void updateVisibility() override;

        /**
         * @brief   Enable or disable the scale mode.[override]
         * @param   isOn: Is the mode enabled
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-08
         */
        void setEnableScale(bool isOn) override;

        /**
         * @brief   Get the shape id by the given shape type and VTK cell id.[override]
         * @param   vtkId: The VTK point or cell id in shape data
         * @param   topAbsShapeType: The shape type of the given ID( the same as TopAbs_ShapeEnum )
         * @return  The shape id
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-22
         */
        int getShapeIdByVTKCellId(int vtkId, FITKAcousticsVTKCommons::ShapeMeshAbsEnum topAbsShapeType) override;

        /**
         * @brief   Get the visibility from the data object.[override]
         * @return  The visibility
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-29
         */
        bool getDataVisibility() override;

    private:
        /**
         * @brief   Generate the vtkDataSet for the sub-system.[override]
         * @param   subSys: The sub-system beam data
         * @return  Is the data valid
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-04
         */
        bool generateDataSet(Acoustics::FITKAbstractSEASubSys* subSys) override;

        /**
         * @brief   Generate the actor with the sub-system data.[override]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-04
         */
        void generateGraph() override;

    };
}   // namespace Exchange

#endif // __FITKACOUSTICSVTKGRAPHOBJECTSEABEAM_H__
